from django.urls import path, include
from rest_framework import routers
from device import viewsets

router = routers.DefaultRouter()
router.register(r'device', viewsets.deviceInfoViewset)
router.register(r'channel', viewsets.channelInfoViewset)
router.register(r'realtimetempera', viewsets.temperatureInfoViewset)
router.register(r'warnningset', viewsets.warningSettingInfoViewset)
router.register(r'warnninginfo', viewsets.warningDeviceInfoViewset)

urlpatterns = [
    path('', include(router.urls)),

    # 根据不同的通道号统计实时的温度信息
    path('realdata/', viewsets.temperatureInfoViewset.as_view({'get': 'getRealData'})),
    # 根据不同的通道号统计各个分区的平均温度
    path('averagedata/', viewsets.temperatureInfoViewset.as_view({'get': 'getAverageData'})),
    # 预测数据
    path('predictdata/', viewsets.temperatureInfoViewset.as_view({'get': 'getPredictData'})),
]